import React from 'react'
import "./style.less"
import { useHistory } from "react-router-dom"

export default function Exit () {

  const history = useHistory();
  function clickHandle () {
    localStorage.removeItem("username");
    history.push("/login")
  }

  return (
    <div className="exit-box">
      <button className="exit" onClick={clickHandle}>退出登录</button>
    </div>
  )
}
